package cc.rengu.igas.bomp.common.enums;

import cc.rengu.oltp.utility.util.StringUtil;

import java.io.Serializable;

/**
 * 商户停用原因枚举
 *
 * @author zhouyi
 * @version 1.0
 * @date 2021/5/31 15:44
 */
public enum MchntStopReasonEnum implements Serializable {
    BLACK_MCHNT("1", "黑名单商户"),
    THREE_MONTHS_NO_TRANS("2", "3个月无交易"),
    TWELVE_MONTHS_NO_TRANS("3", "12个月无交易"),
    MANAGEMENT_EXP("4", "经营异常"),
    TELECOM_FRAUD("5", "涉嫌电信诈骗"),
    CERT_EXPIRED("7", "证件到期");

    MchntStopReasonEnum(String stopReasonCode, String stopReasonDesc) {
        this.stopReasonCode = stopReasonCode;
        this.stopReasonDesc = stopReasonDesc;
    }

    public String getStopReasonCode() {
        return stopReasonCode;
    }

    public String getStopReasonDesc() {
        return stopReasonDesc;
    }

    private String stopReasonCode;
    private String stopReasonDesc;

    public static String getMchntStopReasonDescByCode(String stopReasonCode) {
        if (StringUtil.isEmptyOrNull(stopReasonCode)) {
            return null;
        }
        for (MchntStopReasonEnum mchntStopReasonEnum : MchntStopReasonEnum.values()) {
            if (stopReasonCode.equals(mchntStopReasonEnum.getStopReasonCode())) {
                return mchntStopReasonEnum.getStopReasonDesc();
            }
        }
        return null;
    }

}
